home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / systems / vm-cms / texshell / compose.xedit < prev    next >
Text File  |  1993-09-27  |  2KB  |  69 lines

  1. /********************************************************************/
  2. /* Package  : TeXShell for CMS, version 2.0                         */
  3. /* Author   : Humberto Jose' Bortolossi                             */
  4. /*                                                                  */
  5. /* Bitnet   : hjbortol at brlncc.bitnet, hjbortol at brfuem.bitnet  */
  6. /* Internet : hjbortol at gauss.impa.br                             */
  7. /*                                                                  */
  8. /* Organizations : Instituto de Matematica Pura e Aplicada (IMPA)   */
  9. /*                 Fundacao Universidade Estadual de Maringa'       */
  10. /*                                                                  */
  11. /* Copyright : This program is freely distributable.                */
  12. /*             You can do changes but, please, keep my name.        */
  13. /*                                                                  */
  14. /* Description : Just call TeX plus FMT                             */
  15. /*                                                                  */
  16. /*                                               (C) Copyright 1992 */
  17. /********************************************************************/
  18.  
  19.  parse arg fm .
  20.  
  21. 'execio 1 diskr PRIMARY FILE' fm '(FINIS'
  22.  pull fn ft .
  23.  
  24.  
  25.  SAVING:
  26.  extract "/alt"
  27.  if alt.1 /= 0 then do
  28.       say 'Save file? (Y/N)'
  29.       pull Answer
  30.       say answer
  31.       if substr(Answer,1,1) = 'Y' | Answer = '' then 'save'
  32.       if substr(Answer,1,1) = 'N' then call CONTINUE
  33.       else signal SAVING
  34.  end
  35.  
  36.  CONTINUE:
  37.  set emsg off
  38. 'listfile TEXSHELL CONFIG * (ALLOC NOHEADER STACK'
  39.  if rc /= 0 then do
  40.     say 'File TEXSHELL CONFIG * not found.'
  41.     say 'Using LaTeX as format.'
  42.     Dropbuf
  43.  end
  44.  else do
  45.     pull . . FileMode . . NumberOfLines .
  46.     DropBuf
  47.    'execio' NumberOfLines 'diskr TEXSHELL CONFIG' FileMode '(FINIS'
  48.     do forever while queued() /= 0
  49.     pull Label Information .
  50.     if Label = 'FORMAT' then do
  51.                           Format = Information
  52.                           DropBuf
  53.                         end
  54.                         else Format = 'LATEX'
  55.     end
  56.  end
  57.  set emsg on
  58.  
  59.  select
  60.  when Format = 'LATEX'  then 'exec latex'  fn ft fm
  61.  when Format = 'TEX'    then 'exec tex'    fn ft fm
  62.  when Format = 'PLATEX' then 'exec platex' fn ft fm
  63.  when Format = 'PTEX'   then 'exec ptex'   fn ft fm
  64.  when Format = 'SLITEX' then 'exec slitex' fn ft fm
  65.  otherwise 'exec latex' fn ft fm
  66.  end
  67.  
  68.  exit 0
  69.